Copyright (C) 2014 Massachusetts Institute of Technology
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Image saved on Monday May 19, 2014 at 9:55:33 PM
  Release 9.2     || Microcode 15.1 || Runtime 15.7 || Win32 1.8 || SF 4.41
  LIAR/i386 4.118 || Edwin 3.116
;You are in an interaction window of the Edwin editor.
;Type `C-h' for help, or `C-h t' for a tutorial.
;`C-h m' will describe some commands.
;`C-h' means: hold down the Ctrl key and type `h'.
;Package: (user)
(define (add-stream x y)
  (stream-map + x y))
;Value: add-stream

(define integrates (cons-stream 1 (add-stream ones integrates)))
;Value: integrates

;Value: integrates

(stream-ref integrates 4)
;Value: 5

;Value: 2

;The object (1 . #[promise 12]), passed as the second argument to integer-add, is not the correct type.
;To continue, call RESTART with an option number:
; (RESTART 6) => Specify an argument to use in its place.
; (RESTART 5) => Return to read-eval-print level 5.
; (RESTART 4) => Return to read-eval-print level 4.
; (RESTART 3) => Return to read-eval-print level 3.
; (RESTART 2) => Return to read-eval-print level 2.
; (RESTART 1) => Return to read-eval-print level 1.
;Start debugger? (y or n): n

(define (divide-stream x y)
  (stream-map / x y))
;Value: divide-stream

(define ones (cons-stream 1 ones))
;Value: ones

(define (mutiple-stream x y)
  (stream-map * x y))
;Value: mutiple-stream

(define (integrate-series s) (mutiple-stream (divide-stream ones integrates) s))
;Value: integrate-series

;Value: integrate-series

(define exp-series
  (cons-stream 1 (integrate-series exp-series)))
;Value: exp-series

;Value: exp-series

(define (cosine-sine-series x)
  (define cosine-series
    (cons-stream 1 (integrate-series sine-series)))
  (define minus-ones
    (cons-stream -1 minus-ones))
  (define sine-series
    (cons-stream 0 (mutiple-stream (integrate-series cosine-series) minus-ones)))
  (cond ((eq? x 'cos) cosine-series)
	((eq? x 'sin) sine-series)))
;Value: cosine-sine-series

(define cos-series
  (cosine-sine-series 'cos))
;Value: cos-series

(define sin-series
  (cosine-sine-series 'sin))
;Value: sin-series

;Unbound variable: cosine-sine-
;To continue, call RESTART with an option number:
; (RESTART 3) => Specify a value to use instead of cosine-sine-.
; (RESTART 2) => Define cosine-sine- to a given value.
; (RESTART 1) => Return to read-eval-print level 1.
;Start debugger? (y or n): n

;3.60 3.61 is too strange.
(stream-ref cos-series 2)
;The object (1 . #[promise 13]), passed as the second argument to integer-add, is not the correct type.
;To continue, call RESTART with an option number:
; (RESTART 7) => Specify an argument to use in its place.
; (RESTART 6) => Return to read-eval-print level 6.
; (RESTART 5) => Return to read-eval-print level 5.
; (RESTART 4) => Return to read-eval-print level 4.
; (RESTART 3) => Return to read-eval-print level 3.
; (RESTART 2) => Return to read-eval-print level 2.
; (RESTART 1) => Return to read-eval-print level 1.
;Start debugger? (y or n): n

(stream-ref exp-series 2)
;The object (1 . #[promise 13]), passed as the second argument to integer-add, is not the correct type.
;To continue, call RESTART with an option number:
; (RESTART 8) => Specify an argument to use in its place.
; (RESTART 7) => Return to read-eval-print level 7.
; (RESTART 6) => Return to read-eval-print level 6.
; (RESTART 5) => Return to read-eval-print level 5.
; (RESTART 4) => Return to read-eval-print level 4.
; (RESTART 3) => Return to read-eval-print level 3.
; (RESTART 2) => Return to read-eval-print level 2.
; (RESTART 1) => Return to read-eval-print level 1.
;Start debugger? (y or n): n

;The object (1 . #[promise 12]), passed as the second argument to integer-add, is not the correct type.
;To continue, call RESTART with an option number:
; (RESTART 5) => Specify an argument to use in its place.
; (RESTART 4) => Return to read-eval-print level 4.
; (RESTART 3) => Return to read-eval-print level 3.
; (RESTART 2) => Return to read-eval-print level 2.
; (RESTART 1) => Return to read-eval-print level 1.
;Start debugger? (y or n): n

;The object (1 . #[promise 12]), passed as the second argument to integer-add, is not the correct type.
;To continue, call RESTART with an option number:
; (RESTART 4) => Specify an argument to use in its place.
; (RESTART 3) => Return to read-eval-print level 3.
; (RESTART 2) => Return to read-eval-print level 2.
; (RESTART 1) => Return to read-eval-print level 1.
;Start debugger? (y or n): x
;Start debugger? (y or n): p
;Start debugger? (y or n): e
;Start debugger? (y or n): n

;Value: -1

;Value: -1

;Value: 0

;The object (1 . #[promise 12]), passed as the second argument to integer-add, is not the correct type.
;To continue, call RESTART with an option number:
; (RESTART 3) => Specify an argument to use in its place.
; (RESTART 2) => Return to read-eval-print level 2.
; (RESTART 1) => Return to read-eval-print level 1.
;Start debugger? (y or n): n

;Value: 0

;Value: 1

(define (add-stream x y)
  (stream-map + x y))

 




